package cn.iocoder.yudao.module.train.controller.wechat.student;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.train.dal.dataobject.connectDTO.StudentUserDTO;
import cn.iocoder.yudao.module.train.dal.dataobject.student.StudentDO;
import cn.iocoder.yudao.module.train.service.student.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;

@RestController
@RequestMapping("/wechat-api/student")
public class WechatStudentController {

    @Autowired
    private StudentService studentService;

    @GetMapping("/list")
    public CommonResult<List<StudentUserDTO>> getStudentList() {
        return success(studentService.getStudentList());
    }

    @GetMapping("/get")
    public CommonResult<StudentUserDTO> getStudent(Long studentId) {
        return success(studentService.getStudent(studentId));
    }
}
